<template>
	<view class="content">
		<u-tabbar :value="cur_tab" :fixed="true" :placeholder="true" :safeAreaInsetBottom="true" zIndex="99">
			<u-tabbar-item :text="item.text" :mid-button="item.midButton ? true : false" :icon="item.icon" @click="toTab(item,index)" v-for="(item,index) in list" :key="index"></u-tabbar-item>
		</u-tabbar>
	</view>
</template>

<script>
	import storage from '@/utils/storage'
	export default {
		data() {
			return {
				cur_tab: this.tabindex,
				list: [{
						'text': '首页',
						'icon': 'home',
						"path": "/pages/index/detail?game_id="+this.homeId
					},
					{
						'text': '地图',
						'icon': 'map',
						"path": "/pages/map/index?game_id="+this.homeId
					},
					{
						'text': '我的',
						'icon': 'account-fill',
						"path": "/pages/mine/index?game_id="+this.homeId
					}
				]
			}
		},
		props:['tabindex','homeId'], //接收到父组件数据
		onShow() {
			
		},
		onPullDownRefresh() {

		},
		onReachBottom() {

		},
		methods: {
			toTab(e,index) {
				uni.redirectTo({
					url: e.path
				})
			},
		}
	}
</script>

<style>

</style>
